package c.a.a.d0;

import android.graphics.PointF;
import c.a.a.b0.k.l;
import c.a.a.d0.h0.c;
import c.a.a.d0.h0.c.a;
import c.a.a.d0.h0.c.b;
import c.a.a.e0.f;
import c.j.a.d.a.i;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/* compiled from: ShapeDataParser */
public class a0 implements g0<l> {
    public static final a0 a = new a0();
    public static final a b = a.a("c", "v", i.j, "o");

    public Object a(c cVar, float f) throws IOException {
        if (cVar.u0() == b.BEGIN_ARRAY) {
            cVar.n();
        }
        cVar.o();
        List list = null;
        List list2 = null;
        List list3 = list2;
        boolean z = false;
        while (cVar.t()) {
            int w0 = cVar.w0(b);
            if (w0 == 0) {
                z = cVar.v();
            } else if (w0 == 1) {
                list = o.c(cVar, f);
            } else if (w0 == 2) {
                list2 = o.c(cVar, f);
            } else if (w0 != 3) {
                cVar.x0();
                cVar.y0();
            } else {
                list3 = o.c(cVar, f);
            }
        }
        cVar.r();
        if (cVar.u0() == b.END_ARRAY) {
            cVar.q();
        }
        if (list == null || list2 == null || list3 == null) {
            throw new IllegalArgumentException("Shape data was missing information.");
        } else if (list.isEmpty()) {
            return new l(new PointF(), false, Collections.emptyList());
        } else {
            int size = list.size();
            PointF pointF = (PointF) list.get(0);
            ArrayList arrayList = new ArrayList(size);
            for (int i = 1; i < size; i++) {
                PointF pointF2 = (PointF) list.get(i);
                int i2 = i - 1;
                arrayList.add(new c.a.a.b0.a(f.a((PointF) list.get(i2), (PointF) list3.get(i2)), f.a(pointF2, (PointF) list2.get(i)), pointF2));
            }
            if (z) {
                PointF pointF3 = (PointF) list.get(0);
                size--;
                arrayList.add(new c.a.a.b0.a(f.a((PointF) list.get(size), (PointF) list3.get(size)), f.a(pointF3, (PointF) list2.get(0)), pointF3));
            }
            return new l(pointF, z, arrayList);
        }
    }
}
